@extends('default.layouts.adminPublic')
@section('title', '防CC攻击Api设置')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/admin/indexList.css')}}">
    @endsection
    @section('content')
            <!--导航开始-->
    <div class="crumb_warp">
        <i class="fa fa-home"></i> <a href="{{url('admin/cc_set')}}">首页</a> &raquo; 防CC攻击Api设置
    </div>
    <!--导航结束-->
    <!--结果集标题与导航组件 开始-->

    <div class="con">

        <div class="conMain">
            <div class="result_wrap">
                <div class="search">
                    <span style="margin-right:30px"><a href="{{url('admin/cc_set')}}"><i class="fa fa-circle"></i>防CC攻击PC设置</a></span>
                    <span><a href="{{url('admin/cc_api_set')}}"><i class="fa  fa-circle-thin"></i>防CC攻击Api设置</a></span>
                </div>
                <div class="message"><h2>防CC攻击Api设置</h2></div>
            </div>
            <div class="manage">
                @include('flash::message')
            </div>
            <div class="conInfo">
                <div class="manage" style="padding: 0; margin-bottom: 10px;">
                    @if(count($errors)>0)
                        <div class="mark">
                            @if(is_object($errors))
                                @foreach($errors->all() as $error)
                                    <p>{{$error}}</p>
                                @endforeach
                            @else
                                <p>{{$errors}}</p>
                            @endif
                        </div>
                    @endif
                </div>
                <div class="conAddList">
                    <form action="{{url('admin/post_cc_api_set')}}" method="post" name="ccForm" id="ccForm" onsubmit="return checkForm('#ccForm')">
                        {{csrf_field()}}
                        <input name="sign" type="hidden" value="api">

                        <dl>
                            <dt>统计模式：</dt>
                            <dd>
                                <input name="statistics"  id="unstatistics" checked style="width: 16px; height: 16px; margin: 0px;" type="radio" value="0">
                                <label for="unstatistics">关</label>
                                <input name="statistics" id="statistics"  style="width: 16px; height: 16px; margin: 0px;" type="radio"   value="1">
                                <label for="statistics">开</label>
                                <span style="color: #ff4400">注：开启以后，不做任何限制！</span>
                            </dd>
                        </dl>
                        <dl>
                            <dt>禁止黑名单：</dt>
                            <dd>
                                <input name="for_blacklist"  id="unfor_blacklist" checked style="width: 16px; height: 16px; margin: 0px;" type="radio" value="0">
                                <label for="unfor_blacklist">关</label>
                                <input name="for_blacklist" id="for_blacklist"  style="width: 16px; height: 16px; margin: 0px;" type="radio"   value="1">
                                <label for="for_blacklist">开</label>
                                <span style="color: #ff4400">注：开启以后，禁止黑名单Ip用户访问！</span>
                            </dd>
                        </dl>
                        <dl>
                            <dt>智能模式：</dt>
                            <dd>
                                <input name="intelligent"  id="unintelligent" checked style="width: 16px; height: 16px; margin: 0px;" type="radio" value="0">
                                <label for="unintelligent">关</label>
                                <input name="intelligent" id="v"  style="width: 16px; height: 16px; margin: 0px;" type="radio"   value="1">
                                <label for="intelligent">开</label>
                                <span style="color: #ff4400">注：开启以后，每分钟访问的次数达到指定数，自动添加到黑名单！</span>
                            </dd>
                        </dl>
                        <dl>
                            <dt>访问次数：</dt>
                            <dd><input type="text" class="inpText" style="width:160px;" name="number" value="{{$number}}" id="number">
                                <span style="color: #ff4400">注：每分钟最大访问的次数（必须填写有效的整型数字）！</span>
                            </dd>
                        </dl>
                        <dl>
                            <dt></dt>
                            <dd>
                                <input type="submit" class="sub" value="设置">
                            </dd>
                        </dl>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->
@endsection

@section('footerjs')
    @parent
    <script>
        @if(!empty($ccSetup))
            $("#ccForm").find("input[name='statistics'][value='{{$ccSetup->statistics}}']").attr("checked", true);
            $("#ccForm").find("input[name='for_blacklist'][value='{{$ccSetup->for_blacklist}}']").attr("checked", true);
            $("#ccForm").find("input[name='intelligent'][value='{{$ccSetup->intelligent}}']").attr("checked", true);
        @endif
    </script>
@endsection

